package sessionbeans;

import javax.ejb.Remote;
import java.util.List;
import entities.PendingFriendship;
import entities.RegisteredUser;

@Remote
public interface FriendshipBeanRemote {

	/**
	 * 
	 * @param userId the specified user's id
	 * @return a list of all the pending friendship requests received by the user
	 */
	List<PendingFriendship> getPendingFriendships(String userId);
	
	/**
	 * 
	 * @param user1 the first user
	 * @param user2 the second user
	 * @return true if the two users are now friends, false otherwise
	 */
	boolean establishFriendship(String user1, String user2);
	
	/**
	 * 
	 * @param userId the specified user's id
	 * @return a list of new potential friends suggested to the user
	 */
	List<RegisteredUser> getSuggestions(String userId);
	
	/**
	 * 
	 * @param receiver the user that has declined the request
	 * @param sender the user who sent the request
	 * @return true if the request has been successfully deleted, false otherwise
	 */
	boolean deleteFriendshipRequest(String receiver, String sender);
	
	/**
	 * 
	 * @param senderId the user ID of the sender
	 * @param receiverId the user ID of the receiver
	 * @return string describing the outcome of the operation
	 */
	String sendFriendshipRequest(String senderId, String receiverId);
	
	/**
	 * 
	 * @param userId1 the session's user
	 * @param userId2 the user whose page is being visited
	 * @return a String stating if the two users are already friends or 
	 * if userId2 is waiting for userId1 to answer a friendship request or
	 * if userId1 is waiting for userId2 to answer a friendship request or
	 * if the are "neutral" to each other 
	 * All this statements are seen from userId1's perspective
	 */
	String getAlreadyFriendsOrAsked(String userId1, String userId2);
}
